package ua.kharkov.khpi.tarasenko.bach.dao.core.tree;

import java.util.List;
import java.util.Map;

import ua.kharkov.khpi.tarasenko.bach.analysis.prefixspan.Node;
import ua.kharkov.khpi.tarasenko.bach.core.db.EShopDataStoreException;

public interface TreeDAO {

	/**
	 * Save node in DB. 
	 * 
	 * @param node - node to save
	 * @return nodeId - id of saved nodes
	 */
	public int saveNode(Node node) throws EShopDataStoreException;
	
	public void savePath(int nodeId, int parentId) throws EShopDataStoreException;

	public List<List<Integer>> getAllPathes() throws EShopDataStoreException;
	
	public Map<Integer, Node> getAllNodes() throws EShopDataStoreException ;
	
	public void deleteTree() throws EShopDataStoreException ;
	
	public List<Integer> getDirectChildNodesId(int parentId) throws EShopDataStoreException ;

	public boolean isTreeInDb() throws EShopDataStoreException;
}
